package 类和对象课堂练习.封装;

public class Zuoye03281 {
    protected String name;
    private int age;
    private int jiaoling;
    private String sex;
//    public Zuoye03281(){}

    public Zuoye03281(String na, int ag, int ji, String se){
        name=na;
        age=ag;
        jiaoling=ji;
        sex=se;
    }
    public void print(){
        System.out.println("是一名"+sex+"老师，名字叫"+name);
        System.out.println("今年"+age+"岁");
        System.out.println("教龄到现在有"+jiaoling+"年了");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getJiaoling() {
        return jiaoling;
    }

    public void setJiaoling(int jiaoling) {
        this.jiaoling = jiaoling;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
//    @Override
//    public String toString(){
//        return "是一名"+sex+"老师，名字叫"+name;      //直接tostring一个要说的话
//    }



}
